<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <script>
        function fid(m) {
            var num = 1;
            if (m === 1 || m === 2) {
                return 1;
            } else {
                var sum = fid(m - 1) + fid(m - 2);
                console.log(m - 1, m - 2, '月份：' + m, '兔子对数' + sum);
                return sum;
            }
        }
        console.log(fid(8));
    </script>
</body>

</html>